<template>
  <div class="container">
    <i-frame v-if="!loading" :src="url" />
  </div>
</template>
<script>
import iFrame from "@/components/iFrame/index";
import {getAccessToken} from '@/utils/auth'
export default {
  name: "Report",
  components: { iFrame },
  data() {
    return {
      url: undefined,
      loading: true
    };
  },
  created() {
    //获取token
    const token = getAccessToken();
    //获取报表ID
    const reportId = this.$route.params.reportId
    //组装路径
    this.url = process.env.VUE_APP_BASE_API + "/jmreport/view/"+ reportId +"?token=" + token;
    this.loading = false;
    console.log(this.url)
  }
};
</script>
<style>
.container {
  padding: 0px 20px;
}
</style>
